<?php
/**
 * SocialEngine
 *
 * @category   Application_Core
 * @package    Activity
 * @copyright  Copyright 2006-2010 Webligo Developments
 * @license    http://www.socialengine.com/license/
 * @version    $Id: Controller.php 9806 2012-10-30 23:54:12Z matthew $
 * @author     John
 */

/**
 * @category   Application_Core
 * @package    Activity
 * @copyright  Copyright 2006-2010 Webligo Developments
 * @license    http://www.socialengine.com/license/
 */
class Country_Widget_RatingController extends Engine_Content_Widget_Abstract
{
  public function indexAction()
  {
    
     $subject = null;
     $viewer = Engine_Api::_()->user()->getViewer();
     if( Engine_Api::_()->core()->hasSubject() ) {
       // Get subject
       $subject = Engine_Api::_()->core()->getSubject();
      
     }
     if (!$subject) {
        return $this->setNoRender();
     }
     
     
     $this->view->country = $subject;
     $this->view->user = $viewer;
     $this->view->viewer_id = $viewer->user_id;
     
     $this->view->viewer_id = $viewer->getIdentity();
     $this->view->rating_count = Engine_Api::_()->country()->ratingCount($subject->getIdentity());
     $this->view->country = $subject;
     $this->view->rated = Engine_Api::_()->country()->checkRated($subject->getIdentity(), $viewer->getIdentity());
  }
}
